home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / Fonts.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  11.7 KB  |  443 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Fonts.a
  3. ;
  4. ;    Contains:    Font Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__FONTS__') = 'UNDEFINED' THEN
  21. __FONTS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29. systemFont                        EQU        0
  30. applFont                        EQU        1
  31. newYork                            EQU        2
  32. geneva                            EQU        3
  33. monaco                            EQU        4
  34. venice                            EQU        5
  35. london                            EQU        6
  36. athens                            EQU        7
  37. sanFran                            EQU        8
  38. toronto                            EQU        9
  39. cairo                            EQU        11
  40. losAngeles                        EQU        12
  41. times                            EQU        20
  42. helvetica                        EQU        21
  43. courier                            EQU        22
  44. symbol                            EQU        23
  45. mobile                            EQU        24
  46. commandMark                        EQU        17
  47. checkMark                        EQU        18
  48. diamondMark                        EQU        19
  49.  
  50. appleMark                        EQU        20
  51. propFont                        EQU        36864
  52. prpFntH                            EQU        36865
  53. prpFntW                            EQU        36866
  54. prpFntHW                        EQU        36867
  55. fixedFont                        EQU        45056
  56. fxdFntH                            EQU        45057
  57. fxdFntW                            EQU        45058
  58. fxdFntHW                        EQU        45059
  59. fontWid                            EQU        44208
  60.  
  61. FMInput                 RECORD    0
  62. family                     ds.w   1        ; offset: $0 (0)
  63. size                     ds.w   1        ; offset: $2 (2)
  64. face                     ds.b   1        ; offset: $4 (4)
  65. needBits                 ds.b   1        ; offset: $5 (5)
  66. device                     ds.w   1        ; offset: $6 (6)
  67. numer                     ds     Point    ; offset: $8 (8)
  68. denom                     ds     Point    ; offset: $C (12)
  69. sizeof                     EQU *            ; size:   $10 (16)
  70.                         ENDR
  71.  
  72. ; typedef struct FMInput     FMInput
  73. FMOutput                 RECORD    0
  74. errNum                     ds.w   1        ; offset: $0 (0)
  75. fontResult                 ds.l   1        ; offset: $2 (2)
  76. boldPixels                 ds.b   1        ; offset: $6 (6)
  77. italicPixels             ds.b   1        ; offset: $7 (7)
  78. ulOffset                 ds.b   1        ; offset: $8 (8)
  79. ulShadow                 ds.b   1        ; offset: $9 (9)
  80. ulThick                     ds.b   1        ; offset: $A (10)
  81. shadowPixels             ds.b   1        ; offset: $B (11)
  82. extra                     ds.b   1        ; offset: $C (12)
  83. ascent                     ds.b   1        ; offset: $D (13)
  84. descent                     ds.b   1        ; offset: $E (14)
  85. widMax                     ds.b   1        ; offset: $F (15)
  86. leading                     ds.b   1        ; offset: $10 (16)
  87. curStyle                 ds.b   1        ; offset: $11 (17)
  88. numer                     ds     Point    ; offset: $12 (18)
  89. denom                     ds     Point    ; offset: $16 (22)
  90. sizeof                     EQU *            ; size:   $1A (26)
  91.                         ENDR
  92.  
  93. ; typedef struct FMOutput     FMOutput
  94. ; typedef FMOutput             *FMOutPtr
  95. FontRec                 RECORD    0
  96. fontType                 ds.w   1        ; offset: $0 (0)        ;font type
  97. firstChar                 ds.w   1        ; offset: $2 (2)        ;ASCII code of first character
  98. lastChar                 ds.w   1        ; offset: $4 (4)        ;ASCII code of last character
  99. widMax                     ds.w   1        ; offset: $6 (6)        ;maximum character width
  100. kernMax                     ds.w   1        ; offset: $8 (8)        ;negative of maximum character kern
  101. nDescent                 ds.w   1        ; offset: $A (10)        ;negative of descent
  102. fRectWidth                 ds.w   1        ; offset: $C (12)        ;width of font rectangle
  103. fRectHeight                 ds.w   1        ; offset: $E (14)        ;height of font rectangle
  104. owTLoc                     ds.w   1        ; offset: $10 (16)        ;offset to offset/width table
  105. ascent                     ds.w   1        ; offset: $12 (18)        ;ascent
  106. descent                     ds.w   1        ; offset: $14 (20)        ;descent
  107. leading                     ds.w   1        ; offset: $16 (22)        ;leading
  108. rowWords                 ds.w   1        ; offset: $18 (24)        ;row width of bit image / 2 
  109. sizeof                     EQU *            ; size:   $1A (26)
  110.                         ENDR
  111.  
  112. ; typedef struct FontRec     FontRec
  113. FMetricRec                 RECORD    0
  114. ascent                     ds.l   1        ; offset: $0 (0)        ;base line to top
  115. descent                     ds.l   1        ; offset: $4 (4)        ;base line to bottom
  116. leading                     ds.l   1        ; offset: $8 (8)        ;leading between lines
  117. widMax                     ds.l   1        ; offset: $C (12)        ;maximum character width
  118. wTabHandle                 ds.l   1        ; offset: $10 (16)        ;handle to font width table
  119. sizeof                     EQU *            ; size:   $14 (20)
  120.                         ENDR
  121.  
  122. ; typedef struct FMetricRec  FMetricRec, *FMetricRecPtr, **FMetricRecHandle
  123. WidEntry                 RECORD    0
  124. widStyle                 ds.w   1        ; offset: $0 (0)        ;style entry applies to
  125. sizeof                     EQU *            ; size:   $2 (2)
  126.                         ENDR
  127.  
  128. ; typedef struct WidEntry     WidEntry
  129. WidTable                 RECORD    0
  130. numWidths                 ds.w   1        ; offset: $0 (0)        ;number of entries - 1
  131. sizeof                     EQU *            ; size:   $2 (2)
  132.                         ENDR
  133.  
  134. ; typedef struct WidTable     WidTable
  135. AsscEntry                 RECORD    0
  136. fontSize                 ds.w   1        ; offset: $0 (0)
  137. fontStyle                 ds.w   1        ; offset: $2 (2)
  138. fontID                     ds.w   1        ; offset: $4 (4)        ;font resource ID
  139. sizeof                     EQU *            ; size:   $6 (6)
  140.                         ENDR
  141.  
  142. ; typedef struct AsscEntry     AsscEntry
  143. FontAssoc                 RECORD    0
  144. numAssoc                 ds.w   1        ; offset: $0 (0)        ;number of entries - 1
  145. sizeof                     EQU *            ; size:   $2 (2)
  146.                         ENDR
  147.  
  148. ; typedef struct FontAssoc     FontAssoc
  149. StyleTable                 RECORD    0
  150. fontClass                 ds.w   1        ; offset: $0 (0)
  151. offset                     ds.l   1        ; offset: $2 (2)
  152. reserved                 ds.l   1        ; offset: $6 (6)
  153. indexes                     ds.b   48        ; offset: $A (10)
  154. sizeof                     EQU *            ; size:   $3A (58)
  155.                         ENDR
  156.  
  157. ; typedef struct StyleTable  StyleTable
  158. NameTable                 RECORD    0
  159. stringCount                 ds.w   1        ; offset: $0 (0)
  160. baseFontName             ds.l   64        ; offset: $2 (2)
  161. sizeof                     EQU *            ; size:   $102 (258)
  162.                         ENDR
  163.  
  164. ; typedef struct NameTable     NameTable
  165. KernPair                 RECORD    0
  166. kernFirst                 ds.b   1        ; offset: $0 (0)        ;1st character of kerned pair
  167. kernSecond                 ds.b   1        ; offset: $1 (1)        ;2nd character of kerned pair
  168. kernWidth                 ds.w   1        ; offset: $2 (2)        ;kerning in 1pt fixed format
  169. sizeof                     EQU *            ; size:   $4 (4)
  170.                         ENDR
  171.  
  172. ; typedef struct KernPair     KernPair
  173. KernEntry                 RECORD    0
  174. kernStyle                 ds.w   1        ; offset: $0 (0)        ;style the entry applies to
  175. kernLength                 ds.w   1        ; offset: $2 (2)        ;length of this entry
  176. sizeof                     EQU *            ; size:   $4 (4)
  177.                         ENDR
  178.  
  179. ; typedef struct KernEntry     KernEntry
  180. KernTable                 RECORD    0
  181. numKerns                 ds.w   1        ; offset: $0 (0)        ;number of kerning entries
  182. sizeof                     EQU *            ; size:   $2 (2)
  183.                         ENDR
  184.  
  185. ; typedef struct KernTable     KernTable
  186. WidthTable                 RECORD    0
  187. tabData                     ds.l   256        ; offset: $0 (0)        ;character widths
  188. fontResult                 ds.l   1        ; offset: $400 (1024)    ;font record used to build table
  189. sExtra                     ds.l   1        ; offset: $404 (1028)    ;space extra used for table
  190. style                     ds.l   1        ; offset: $408 (1032)    ;extra due to style
  191. fID                         ds.w   1        ; offset: $40C (1036)    ;font family ID
  192. fSize                     ds.w   1        ; offset: $40E (1038)    ;font size request
  193. face                     ds.w   1        ; offset: $410 (1040)    ;style (face) request
  194. device                     ds.w   1        ; offset: $412 (1042)    ;device requested
  195. inNumer                     ds     Point    ; offset: $414 (1044)    ;scale factors requested
  196. inDenom                     ds     Point    ; offset: $418 (1048)    ;scale factors requested
  197. aFID                     ds.w   1        ; offset: $41C (1052)    ;actual font family ID for table
  198. fHand                     ds.l   1        ; offset: $41E (1054)    ;family record used to build up table
  199. usedFam                     ds.b   1        ; offset: $422 (1058)    ;used fixed point family widths
  200. aFace                     ds.b   1        ; offset: $423 (1059)    ;actual face produced
  201. vOutput                     ds.w   1        ; offset: $424 (1060)    ;vertical scale output value
  202. hOutput                     ds.w   1        ; offset: $426 (1062)    ;horizontal scale output value
  203. vFactor                     ds.w   1        ; offset: $428 (1064)    ;vertical scale output value
  204. hFactor                     ds.w   1        ; offset: $42A (1066)    ;horizontal scale output value
  205. aSize                     ds.w   1        ; offset: $42C (1068)    ;actual size of actual font used
  206. tabSize                     ds.w   1        ; offset: $42E (1070)    ;total size of table
  207. sizeof                     EQU *            ; size:   $430 (1072)
  208.                         ENDR
  209.  
  210. ; typedef struct WidthTable  WidthTable
  211. FamRec                     RECORD    0
  212. ffFlags                     ds.w   1        ; offset: $0 (0)        ;flags for family
  213. ffFamID                     ds.w   1        ; offset: $2 (2)        ;family ID number
  214. ffFirstChar                 ds.w   1        ; offset: $4 (4)        ;ASCII code of 1st character
  215. ffLastChar                 ds.w   1        ; offset: $6 (6)        ;ASCII code of last character
  216. ffAscent                 ds.w   1        ; offset: $8 (8)        ;maximum ascent for 1pt font
  217. ffDescent                 ds.w   1        ; offset: $A (10)        ;maximum descent for 1pt font
  218. ffLeading                 ds.w   1        ; offset: $C (12)        ;maximum leading for 1pt font
  219. ffWidMax                 ds.w   1        ; offset: $E (14)        ;maximum widMax for 1pt font
  220. ffWTabOff                 ds.l   1        ; offset: $10 (16)        ;offset to width table
  221. ffKernOff                 ds.l   1        ; offset: $14 (20)        ;offset to kerning table
  222. ffStylOff                 ds.l   1        ; offset: $18 (24)        ;offset to style mapping table
  223. ffProperty                 ds.w   9        ; offset: $1C (28)        ;style property info
  224. ffIntl                     ds.w   2        ; offset: $2E (46)        ;for international use
  225. ffVersion                 ds.w   1        ; offset: $32 (50)        ;version number
  226. sizeof                     EQU *            ; size:   $34 (52)
  227.                         ENDR
  228.  
  229. ; typedef struct FamRec     FamRec
  230. ;
  231. ; pascal void InitFonts(void)
  232. ;
  233.     IF ¬ GENERATINGCFM THEN
  234.         _InitFonts:    OPWORD    $A8FE
  235.     ELSE
  236.         IMPORT_CFM_FUNCTION    InitFonts
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal void GetFontName(short familyID, Str255 name)
  241. ;
  242.     IF ¬ GENERATINGCFM THEN
  243.         _GetFontName:    OPWORD    $A8FF
  244.     ELSE
  245.         IMPORT_CFM_FUNCTION    GetFontName
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal void GetFNum(ConstStr255Param name, short *familyID)
  250. ;
  251.     IF ¬ GENERATINGCFM THEN
  252.         _GetFNum:    OPWORD    $A900
  253.     ELSE
  254.         IMPORT_CFM_FUNCTION    GetFNum
  255.     ENDIF
  256.  
  257. ;
  258. ; pascal Boolean RealFont(short fontNum, short size)
  259. ;
  260.     IF ¬ GENERATINGCFM THEN
  261.         _RealFont:    OPWORD    $A902
  262.     ELSE
  263.         IMPORT_CFM_FUNCTION    RealFont
  264.     ENDIF
  265.  
  266. ;
  267. ; pascal void SetFontLock(Boolean lockFlag)
  268. ;
  269.     IF ¬ GENERATINGCFM THEN
  270.         _SetFontLock:    OPWORD    $A903
  271.     ELSE
  272.         IMPORT_CFM_FUNCTION    SetFontLock
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal FMOutPtr FMSwapFont(const FMInput *inRec)
  277. ;
  278.     IF ¬ GENERATINGCFM THEN
  279.         _FMSwapFont:    OPWORD    $A901
  280.     ELSE
  281.         IMPORT_CFM_FUNCTION    FMSwapFont
  282.     ENDIF
  283.  
  284. ;
  285. ; pascal void SetFScaleDisable(Boolean fscaleDisable)
  286. ;
  287.     IF ¬ GENERATINGCFM THEN
  288.         _SetFScaleDisable:    OPWORD    $A834
  289.     ELSE
  290.         IMPORT_CFM_FUNCTION    SetFScaleDisable
  291.     ENDIF
  292.  
  293. ;
  294. ; pascal void FontMetrics(FMetricRecPtr theMetrics)
  295. ;
  296.     IF ¬ GENERATINGCFM THEN
  297.         _FontMetrics:    OPWORD    $A835
  298.     ELSE
  299.         IMPORT_CFM_FUNCTION    FontMetrics
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal void SetFractEnable(Boolean fractEnable)
  304. ;
  305.     IF ¬ GENERATINGCFM THEN
  306.         _SetFractEnable:    OPWORD    $A814
  307.     ELSE
  308.         IMPORT_CFM_FUNCTION    SetFractEnable
  309.     ENDIF
  310.  
  311. ;
  312. ; pascal short GetDefFontSize(void)
  313. ;
  314.     IF ¬ GENERATINGCFM THEN
  315.         Macro
  316.         _GetDefFontSize
  317.             dc.w     $3EB8
  318.             dc.w     $0BA8
  319.             dc.w     $6604
  320.             dc.w     $3EBC
  321.             dc.w     $000C
  322.         EndM
  323.     ELSE
  324.         IMPORT_CFM_FUNCTION    GetDefFontSize
  325.     ENDIF
  326.  
  327. ;
  328. ; pascal Boolean IsOutline(Point numer, Point denom)
  329. ;
  330.     IF ¬ GENERATINGCFM THEN
  331.         Macro
  332.         _IsOutline
  333.             moveq    #0,d0
  334.             dc.w     $A854
  335.         EndM
  336.     ELSE
  337.         IMPORT_CFM_FUNCTION    IsOutline
  338.     ENDIF
  339.  
  340. ;
  341. ; pascal void SetOutlinePreferred(Boolean outlinePreferred)
  342. ;
  343.     IF ¬ GENERATINGCFM THEN
  344.         Macro
  345.         _SetOutlinePreferred
  346.             moveq    #1,d0
  347.             dc.w     $A854
  348.         EndM
  349.     ELSE
  350.         IMPORT_CFM_FUNCTION    SetOutlinePreferred
  351.     ENDIF
  352.  
  353. ;
  354. ; pascal Boolean GetOutlinePreferred(void)
  355. ;
  356.     IF ¬ GENERATINGCFM THEN
  357.         Macro
  358.         _GetOutlinePreferred
  359.             moveq    #9,d0
  360.             dc.w     $A854
  361.         EndM
  362.     ELSE
  363.         IMPORT_CFM_FUNCTION    GetOutlinePreferred
  364.     ENDIF
  365.  
  366. ;
  367. ; pascal OSErr OutlineMetrics(short byteCount, const void *textPtr, Point numer, Point denom, short *yMax, short *yMin, FixedPtr awArray, FixedPtr lsbArray, RectPtr boundsArray)
  368. ;
  369.     IF ¬ GENERATINGCFM THEN
  370.         Macro
  371.         _OutlineMetrics
  372.             moveq    #8,d0
  373.             dc.w     $A854
  374.         EndM
  375.     ELSE
  376.         IMPORT_CFM_FUNCTION    OutlineMetrics
  377.     ENDIF
  378.  
  379. ;
  380. ; pascal void SetPreserveGlyph(Boolean preserveGlyph)
  381. ;
  382.     IF ¬ GENERATINGCFM THEN
  383.         Macro
  384.         _SetPreserveGlyph
  385.             moveq    #10,d0
  386.             dc.w     $A854
  387.         EndM
  388.     ELSE
  389.         IMPORT_CFM_FUNCTION    SetPreserveGlyph
  390.     ENDIF
  391.  
  392. ;
  393. ; pascal Boolean GetPreserveGlyph(void)
  394. ;
  395.     IF ¬ GENERATINGCFM THEN
  396.         Macro
  397.         _GetPreserveGlyph
  398.             moveq    #11,d0
  399.             dc.w     $A854
  400.         EndM
  401.     ELSE
  402.         IMPORT_CFM_FUNCTION    GetPreserveGlyph
  403.     ENDIF
  404.  
  405. ;
  406. ; pascal OSErr FlushFonts(void)
  407. ;
  408.     IF ¬ GENERATINGCFM THEN
  409.         Macro
  410.         _FlushFonts
  411.             moveq    #12,d0
  412.             dc.w     $A854
  413.         EndM
  414.     ELSE
  415.         IMPORT_CFM_FUNCTION    FlushFonts
  416.     ENDIF
  417.  
  418. ;
  419. ; pascal short GetSysFont(void)
  420. ;
  421.     IF ¬ GENERATINGCFM THEN
  422.         Macro
  423.         _GetSysFont         &dest=(sp)
  424.         move.w               $0BA6,&dest
  425.         EndM
  426.     ELSE
  427.         IMPORT_CFM_FUNCTION    GetSysFont
  428.     ENDIF
  429.  
  430. ;
  431. ; pascal short GetAppFont(void)
  432. ;
  433.     IF ¬ GENERATINGCFM THEN
  434.         Macro
  435.         _GetAppFont         &dest=(sp)
  436.         move.w               $0984,&dest
  437.         EndM
  438.     ELSE
  439.         IMPORT_CFM_FUNCTION    GetAppFont
  440.     ENDIF
  441.  
  442.     ENDIF ; __FONTS__
  443.